Filter an array of objects from a dynamic array